<?php
// Database connection

  $hostName = 'localhost';
  $username = 'root';
  $password = '';
  $dbName = 'nb158e';

  $link = mysql_connect($hostName, $username, $password) or die('Unable to connect Mysql '.mysql_error());

  mysql_select_db($dbName, $link) or die('Unable to connect Mysql '.mysql_error());

// End Db Connection


  function pr($array=array())
  {
    echo '<pre style="color:#FFF;background-color:#000">';
    print_r($array);
    echo '</pre>';
  }

  function getStatus($status=0,$id=0)
  {
    $page = isset($_GET['page'])?$_GET['page']:1;
    $status = ($status==0)?
    "<a href=\"select_user_search.php?status=1&id={$id}&page={$page}\">Inactive</a>":
    "<a href=\"select_user_search.php?status=0&id={$id}&page={$page}\">Active</a>";
  return $status;
  }

  function updateStatus($status=0,$id=0 )
  {
    echo $query = "UPDATE `users` SET `status`='$status' WHERE `id`='$id'";
  mysql_query($query);

  return mysql_affected_rows();
  }
